package com.wc.alorithm_luogu._动态规划._状压DP.吃奶酪;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/5/17 10:53
 * @description https://www.luogu.com.cn/problem/P1433
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 16;
    static double INF = 1e30;
    static double[][] f = new double[1 << N][N];
    static int[][] state = new int[N][1 << N];
    static double[][] a = new double[N][2];
    static int n;

    public static void main(String[] args) {
        n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            a[i][0] = sc.nextDouble();
            a[i][1] = sc.nextDouble();
        }
        for (int i = 0; i < 1 << n; i++) Arrays.fill(f[i], INF);
        for (int i = 0; i < n; i++) f[1 << i][i] = getD(a[i][0], a[i][1]);
        for (int i = 0; i < 1 << n; i++) {
            int cnt = check(i);
            state[cnt][++state[cnt][0]] = i;
        }

        for (int i = 2; i <= n; i++) {
            for (int j = 1; j <= state[i][0]; j++) {
                int st = state[i][j];
                // last
                for (int k = 0; k < n; k++) {
                    if ((st >> k & 1) == 1) {
                        for (int l = 0; l < n; l++) {
                            if ((st >> l & 1) == 1 && l != k) {
                                double d = getD(a[l][0] - a[k][0], a[l][1] - a[k][1]);
                                f[st][k] = Math.min(f[st][k], f[st ^ (1 << k)][l] + d);
                            }
                        }
                    }
                }
            }
        }
        double res = INF;
        for (int i = 0; i < n; i++) res = Math.min(f[(1 << n) - 1][i], res);
        out.printf("%.2f\n", res);
        out.flush();
    }

    static int check(int x) {
        int res = 0;
        for (int i = 0; i < n; i++) {
            res += x >> i & 1;
        }
        return res;
    }

    static double getD(double dx, double dy) {
        return Math.sqrt(dx * dx + dy * dy);
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
